﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class npc : unit ,IInteractable
{
    [SerializeField]
    protected int dmg;
    [SerializeField]
    private float atkRange;
    [SerializeField]
    private Window window;
    public bool MyIsInteracting { get; set; }
    public int Dmg { get => dmg; set => dmg = value; }
    public float AtkRange { get => atkRange; set => atkRange = value; }
    public float AttackTime { get; set; }
    public override void ReceiveDMG(float dmg, Transform source)
    {
        base.ReceiveDMG(dmg, source);
    }
    public virtual void Deselect()
    {

    }
    public virtual Transform Select()
    {
        return hitbox;
    }
    public virtual void Interact()
    {
        if (!MyIsInteracting)
        {
            MyIsInteracting = true;
            window.Open(this);
            
        }
        
    }
    private void Awake()
    {
        MyAlignment = Alignment(MyReputation, MyLawfullness);

    }
    public virtual void StopInteract()
    {
        if (MyIsInteracting)
        {

            MyIsInteracting = false;
            window.Close();
            Player.MyInstance.MyInteractables.Clear();
        }
    }
}
